<%- include fheader.ejs%>
<style>
    .larger{
        -webkit-transform: scale(1.6);
        transform: scale(1.6);
        display: inline-block;
        padding: 0 5px;
    }
    .ui-dialog .ui-btn-group button {
        background-color: inherit !important;
        color: #00a5e0;
        border-radius: inherit;
    }
    .blue{color:#00a5e0}
    #userinf:after{
        content: '';
        right:0;
    }
    #userinf .ui-list-info{
        -webkit-box-orient: horizontal;-webkit-box-pack: justify;font-size: 14px;padding-right: 15px
    }
</style>
<ul class="ui-list ui-border-tb">
    <li class="ui-border-t">
        <div class="ui-avatar">
            <span style="background-image:url(<%= avatar||'/wx/img/icon_pbone.png'%>)"></span>
        </div>
        <div class="ui-list-info">
            <h4 class="ui-nowrap">你好, <%= acc_name%></h4>
        </div>
    </li>
    <li class="ui-border-t">
        <div class="ui-list-info" style="-webkit-box-orient: horizontal;-webkit-box-pack: justify;">
            <h4 class="ui-nowrap">本周收益</h4>
            <div class="ui-txt-info blue" style="font-size: 18px"><%= fee%>元</div>
        </div>
    </li>
</ul>

<ul class="ui-list ui-border-tb ui-list-link" style="margin-top: 10px">
    <li class="ui-border-t" id="userinf">
        <div class="ui-list-info">
            <h4 id="userRank" class="ui-nowrap">
                <span style="font-size: 14px">名次:</span><span style="font-size: 20px"><%= rank%></span>
            </h4>
            <div>已销售<span id="userSaleCount" class="larger"><%=cnt%></span>笔</div>
        </div>
    </li>
    <li class="ui-border-t">
        <a class="ui-list-info ui-txt-default" href="/rest/svcWxPage/rank">
            查看本周排行榜
        </a>
    </li>
</ul>

<h2 style="font-size: 14px;display: none;">更换后信息改变，下次需重新登录</h2>

<div style="margin: 30px 10% 0">
    <a data-href="/rest/svcWxPage/logout" id="btnLogout" style="background: #fff;color: #18b4ed;border: 1px solid #18b4ed;" class="ui-btn ui-btn-lg ui-btn-primary">
        退出登录
    </a>
</div>
<%- include navbar.ejs%>
<script>
    $(function() {

        var userSaleCount = '<%=cnt%>';
        var userRank = '<%=rank%>'

        $('#btnLogout').tap(function() {
            var $this = $(this);
            var dia = $.dialog({
                title: '',
                content: '确认要退出吗?',
                button: ["确认", "取消"]
            });

            dia.on("dialog:action", function (e) {
                if (e.index == 0) {
                    location.href = $this.data('href');
                }
            });
        });

        if(userSaleCount==0){
            $('#userSaleCount').text('0');
            $('#userRank').text('暂无数据');
        }

    });
</script>
<%- include ftailer.ejs%>